package fr.liglab.adele.icasa.house.abstraction;

import java.util.ArrayList;
import java.util.List;

import fr.liglab.adele.icasa.environment.SimulatedEnvironment;
import fr.liglab.adele.icasa.house.factory.dao.GenesisDeviceDAO;
import fr.liglab.adele.icasa.house.util.RoomAdvertiseListener;


public abstract class AbstractRoom implements Room {

	private final List<GenesisDeviceDAO> devices=new ArrayList<GenesisDeviceDAO>();

	
	public List<GenesisDeviceDAO> getDevices(){
		return devices;
	}
	
	protected void deactivateDevices(){
		for(GenesisDeviceDAO gd:getDevices()){
			gd.getInstanceManager().dispose();
		}
	}
	
	public void notifyDeviceEvent() {
		System.err.println("No notifyDevice implemented.");
	}
	
	public void addListener(RoomAdvertiseListener listener) {
		System.err.println("No addListener implemented.");
	}
	
	public abstract SimulatedEnvironment getEnvironment();
	
	public void setPresence(double nbPeople) {
		getEnvironment().setProperty(SimulatedEnvironment.PRESENCE, nbPeople);			
	}
	
}
